/*
 * 类名称:AdminDictService.java
 * 包名称:com.iotechn.unimall.admin.api.dict
 *
 * 修改履历:
 *     日期                       修正者        主要内容
 *     2020-06-24 14:12:06        lin     初版做成
 *
 * Copyright (c) 2019-2019 浵浵科技
 */
package com.iotechn.unimall.admin.api.dict;

import com.iotechn.unimall.core.annotation.HttpMethod;
import com.iotechn.unimall.core.annotation.HttpOpenApi;
import com.iotechn.unimall.core.annotation.HttpParam;
import com.iotechn.unimall.core.annotation.HttpParamType;
import com.iotechn.unimall.core.annotation.param.NotNull;
import com.iotechn.unimall.core.annotation.param.Range;
import com.iotechn.unimall.core.exception.ServiceException;
import com.iotechn.unimall.data.domain.DictDO;
import com.iotechn.unimall.data.model.Page;

import java.util.List;
import java.util.Map;

/**
 * Admin系统字典表Service接口
 *
 * @author lin
 * @date 2020-06-24 14:12:06
 */

@HttpOpenApi(group = "admin.dict", description = "字典管理")
public interface AdminDictService {

    @HttpMethod(description = "获取部字典")
    public List<DictDO> dicListByDatatype(@HttpParam(name = "datatype", type = HttpParamType.COMMON, description = " 数据类别,首字母大写 ") String datatype) throws ServiceException;

    @HttpMethod(description = "创建", permission = "admin:dict:create", permissionParentName = "系统管理", permissionName = "字典管理")
            public Integer create(
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
            @NotNull @HttpParam(name = "dictDO", type = HttpParamType.COMMON, description = "系统字典表信息") DictDO dictDO) throws ServiceException;


    @HttpMethod(description = "删除", permission = "admin:dict:delete", permissionParentName = "系统管理", permissionName = "字典管理")
    public Boolean delete(
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "系统字典表Id") Long id) throws ServiceException;


    @HttpMethod(description = "修改", permission = "admin:dict:update", permissionParentName = "系统管理", permissionName = "字典管理")
    public Boolean update(
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
            @NotNull @HttpParam(name = "dictDO", type = HttpParamType.COMMON, description = "系统字典表信息") DictDO dictDO) throws ServiceException;


    @HttpMethod(description = "详情", permission = "admin:dict:info", permissionParentName = "系统管理", permissionName = "字典管理")
    public DictDO info(
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "系统字典表Id") Long id) throws ServiceException;

    /**
     * 分页查询
     */
    @HttpMethod(description = "查询", permission = "admin:dict:list", permissionParentName = "系统管理", permissionName = "字典管理")
    public Page<DictDO> list(
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId,
            @HttpParam(name = "id", type = HttpParamType.COMMON, description = "id") Long id,
            @HttpParam(name = "datadesc", type = HttpParamType.COMMON, description = " 数据类别,首字母大写 ") String datadesc,
            @HttpParam(name = "datatype", type = HttpParamType.COMMON, description = " 数据类别,首字母大写 ") String datatype,
            @HttpParam(name = "datacode", type = HttpParamType.COMMON, description = " 数据编码 ") String datacode,
            @Range(min = 1) @HttpParam(name = "page", type = HttpParamType.COMMON, description = "当前页码") Integer pageNo,
            @Range(min = 1) @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度") Integer limit) throws ServiceException;

}
